package cn.zcq100.Proxp.Demo1;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;

@SuppressWarnings("serial")
public class MyServiceImpl extends UnicastRemoteObject implements MyService {
	public MyServiceImpl() throws RemoteException{
		
	}
	
	@Override
	public String sayHello() throws RemoteException {
		return "Server : Hello ";
	}


	public static void main(String[] args) {
		try {
			MyService service=new MyServiceImpl();
			Naming.rebind("rmi://127.0.0.1/service", service);
		} catch (Exception e) {
			e.printStackTrace();
		}

	}

}
